package tr.edu.ege.kipler.satisfiability.syntactical;

import java.util.LinkedHashSet;
import java.util.Set;

import tr.edu.ege.kipler.syntax.concept.BinaryConcept;
import tr.edu.ege.kipler.syntax.concept.ConceptName;
import tr.edu.ege.kipler.syntax.concept.ConceptVisitor;
import tr.edu.ege.kipler.syntax.concept.ModalConcept;
import tr.edu.ege.kipler.syntax.concept.Nominal;
import tr.edu.ege.kipler.syntax.concept.QualifiedNoRestriction;
import tr.edu.ege.kipler.syntax.concept.RoleQuantification;

/**
 * 
 * @author İnanç Seylan
 *
 */
public class NominalCollectionFromDescriptionVisitor implements
		ConceptVisitor {
	
	private Set<String> nominalSet = new LinkedHashSet<String>();

	public Set<String> getNominalSet() {
		return nominalSet;
	}

	public void visitBinaryConcept(BinaryConcept bd) {
		bd.getLhs().accept(this);
		bd.getRhs().accept(this);
	}

	public void visitConceptName(ConceptName c) {
		// nothing to do
	}

	public void visitModalConcept(ModalConcept md) {
		md.getConcept().accept(this);
	}

	public void visitNominal(Nominal nominal) {
		nominalSet.add(nominal.getName());
	}

	public void visitQualifiedNoRestriction(QualifiedNoRestriction restriction) {
		restriction.getConcept().accept(this);
	}

	public void visitRoleQuantification(RoleQuantification restriction) {
		restriction.getConcept().accept(this);
	}

}
